#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int a, b;
    int n = 0;
    scanf("%d %d", &a, &b);
    for (; a >= 0 && a <= b && b <= 10000; ++a)//
    {
        if ((a * a) % 10 == a || (a * a) % 100 == a || (a * a) % 1000 == a || (a * a) % 10000 == a)
        {
            printf("%d\n", a);
            ++n;
        }
    }
    if (n == 0)
    {
        printf("None");
    }
    return 0;
}